home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / pgs3f.lha / 3.0fUpdate / Macros.LHA / BMEcmdshell.rexx < prev    next >
OS/2 REXX Batch file  |  1994-09-20  |  2KB  |  58 lines

  1. /* $VER: BMEcmdshell.rexx 1.0 (02.9.94)
  2.    Copyright 1994 Soft-Logik Publishing Corporation
  3.    May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4.  
  5. options results
  6. options failat 100
  7.  
  8. open('console', 'CON:0/9999/9999/50/BME/SCREEN BME', 'RW')
  9. writeln('console', 'Enter commands, "Q" to exit.')
  10.  
  11. address BME
  12.  
  13. /* loop until user exits */
  14. do forever
  15.  
  16.         /* get command string from user */
  17.         writech('console','CMD> ')
  18.         cmd=readln('console')
  19.  
  20.         select
  21.  
  22.                 /* time to quit? */
  23.                 when (upper(cmd) = "Q") then do
  24.                         leave
  25.                 end
  26.  
  27.                 /* need some help? */
  28.                 when (cmd = "?") then do
  29.                         writeln('console', 'Enter "Q" to exit command shell.')
  30.                 end
  31.  
  32.                 /* do nothing on empty lines */
  33.                 when (cmd = "") then do
  34.                         nop
  35.                 end
  36.  
  37.                 /* whatsinaline */
  38.                 otherwise do
  39.                         /* execute the command string */
  40.                         cmd
  41.  
  42.                         /* if ok show the result, if any */
  43.                         if (RC = 0) then do
  44.                                 if result ~= "RESULT" then writeln('console', result)
  45.                                 if (upper(cmd) = "QUIT") then leave
  46.                         end
  47.  
  48.                         else do
  49.                                 /* ERROR!!!!   get fault string from MCEd */
  50.                                 writeln('console', '*** Error');
  51.                         end
  52.                 end
  53.         end
  54. end
  55.  
  56. exit(0)
  57.  
  58.